import http from '@http';

const API_PREFIX = '/system/role/allocated';

export function fetchGetAllocatedUserList(roleId, allocated = true, values) {
  return http.post(`${API_PREFIX}/user/list?allocated=${allocated}&roleId=${roleId}`, values);
}

export function fetchAddAllocatedUser(values) {
  return http.post(API_PREFIX + '/user/add', values);
}

export function fetchCancelAllocatedUser(values) {
  return http.post(API_PREFIX + '/user/cancel', values);
}

export function fetchGetAllocatedMenuTree(id) {
  return http.get(API_PREFIX + '/menu/info/role_' + id);
}

export function fetchUpdateAllocatedMenu(values) {
  return http.post(API_PREFIX + '/menu/update', values);
}
